﻿CREATE PROCEDURE [dbo].[users_profile_update]
    @userId int,
    @avatar nvarchar(256),
    @email nvarchar(256),
    @password binary(32),
    @salt binary(8),
    @login nvarchar(256),
    @registrationDate datetime2,
    @status tinyint,
    @lastUpdateDate datetime2
AS
UPDATE [dbo].[Users] SET     [dbo].[Users].[Avatar] = @avatar,
    [dbo].[Users].[Email] = @email,
    [dbo].[Users].[Password] = @password,
    [dbo].[Users].[Salt] = @salt,
    [dbo].[Users].[Login] = @login,
    [dbo].[Users].[RegistrationDate] = @registrationDate,
    [dbo].[Users].[Status] = @status,
    [dbo].[Users].[LastUpdateDate] = @lastUpdateDate
WHERE
    [dbo].[Users].[UserId]=@userId
SELECT
    [UserId],
    [Avatar],
    [Email],
    [Password],
    [Salt],
    [Login],
    [RegistrationDate],
    [Status],
    [LastUpdateDate]
FROM [dbo].[Users] 
WHERE
    Users.[UserId]=@userId

RETURN 0
